<template>
	<view class="uni_box home">
		<navbar title='个人资料' :yin="false">
		</navbar>
		<view class="content">
			<view class="xinxi">
				<view class="mpone">
					<view class="touview" @click="upload">
						<image class="tou2" :src="user.avatar?user.avatar:'/static/mine/tous.png'" />
						<!-- <image class="xj" src="/static/mine/tous.png" /> -->
					</view>
					
					<view class="mpright">
						<text class="xiugai">修改头像</text>
					</view>
					<image class="ricons" src="/static/mine/ricons.png" />
				</view>
				<view class="uone" @click="getyhuming">
					<view class="ushuru">
						<text class="lval">昵称</text>
						<text class="xuantit" :class="user.nickname?'xuanactive':''">{{ user.nickname?user.nickname:'请输入昵称' }}</text>
						<!-- <u-input v-model="user.nickname" type="text" :border="false" placeholder="请输入"/> -->
						<image class="ricons" src="/static/mine/ricons.png" />
					</view>
				</view>
				<view class="uone">
					<view class="ushuru">
						<text class="lval">邀请码</text>
						<text class="xuantit" :class="user.code?'xuanactive':''">{{ user.code?user.code:'请输入邀请码' }}</text>
						<image class="icon_fz" @click="copy(user.code)" src="/static/mine/icon_fz.png" />
						<!-- <u-input v-model="user.nickname" type="text" :border="false" placeholder="请输入"/> -->
						<!-- <image class="ricons" src="/static/mine/ricons.png" /> -->
					</view>
				</view>
				<view class="uone">
					<!--  @click="getshouji" -->
					<view class="ushuru">
						<text class="lval">手机号</text>
						<text class="xuantit" :class="user.mobile?'xuanactive':''">{{ user.mobile?user.mobile:'请输入手机号' }}</text>
						<!-- <u-input v-model="user.phone" :value="user.phone" type="text" :border="false" placeholder="请输入"/> -->
						<!-- <image class="ricons" src="/static/mine/ricons.png" /> -->
					</view>
				</view>
				<view class="uone">
					<view class="ushuru">
						<text class="lval">注册时间</text>
						<text class="xuantit" :class="user.createtime?'xuanactive':''">{{ user.createtime?user.createtime:'请输入注册时间' }}</text>
					</view>
				</view>
				<view class="uone">
					<view class="ushuru" @click="getxiumi">
						<text class="lval">登录密码</text>
						<!-- <text class="xuantit" :class="user.wechat_code?'xuanactive':''">{{ user.wechat_code?user.wechat_code:'请输入' }}</text> -->
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				<!-- #ifdef APP-PLUS -->
				<view class="uone">
					<view class="ushuru" @click="getweijie">
						<text class="lval" style="width: 200px;">解除微信绑定</text>
						<!-- <text class="xuantit" :class="user.wechat_code?'xuanactive':''">{{ user.wechat_code?user.wechat_code:'请输入' }}</text> -->
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				<!-- #endif -->
				<!-- <view class="uone" @click="getdiqu">
					<view class="ushuru">
						<text class="lval">所在地</text>
						<text class="xuantit" :class="diinfo?'xuanactive':''">{{ diinfo?diinfo:'请选择地址' }}</text>
						<image class="ricons" src="/static/mine/ricons.png" />
					</view>
				</view> -->
				<!-- <view class="uone"  @click="getxiumi">
					<view class="ushuru">
						<text class="lval">登录密码</text>
						<text class="xuantit">请选择修改密码</text>
						<image class="ricons" src="/static/mine/ricons.png" />
					</view>
				</view> -->

				
			</view>
			<view class="xinxi">
				<view class="uone">
					<view class="ushuru"  @click="ptwoClick(4)">
						<text class="lval">实名认证</text>
						<text class="xuantit" :class="user.sf_name?'xuanactive':''">{{ user.sf_name?user.sf_name:'请输入' }}</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				<view class="uone">
					<view class="ushuru" @click="ptwoClick(1)">
						<text class="lval">支付宝账号</text>
						<text class="xuantit" :class="user.alipay_code?'xuanactive':''">{{ user.alipay_code?user.alipay_code:'请输入' }}</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				<view class="uone">
					<view class="ushuru" @click="ptwoClick(2)">
						<text class="lval">银行卡账号</text>
						<text class="xuantit" :class="user.bank_code?'xuanactive':''">{{ user.bank_code?user.bank_code:'请输入' }}</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				<view class="uone">
					<view class="ushuru" @click="ptwoClick(3)">
						<text class="lval">微信号</text>
						<text class="xuantit" :class="user.wechat_code?'xuanactive':''">{{ user.wechat_code?user.wechat_code:'请输入' }}</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
			</view>
			<view class="xinxi">
				<view class="uone" @click="ziliaoClick(3)">
					<view class="ushuru">
						<text class="lval">用户协议</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				<view class="uone" @click="ziliaoClick(4)">
					<view class="ushuru">
						<text class="lval">隐私协议</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>
				
				<view class="uone" v-if="banben" @click="getpugying()">
					<view class="ushuru">
						<text class="lval">版本号</text>
						<text class="xuantit xuanactive" style="margin-right: 6rpx;">Version {{banben}}</text>
						<image class="ricons ml" src="/static/mine/ricons.png" />
					</view>
				</view>

			</view>

			<view class="tuichu" @click="gettui">退出登录</view>
			</view>

		<u-select v-model="bshow" :list="blist" @confirm="bconfirm"></u-select>

		<!-- 修改用户名 -->
		<view class="yhupopview">
			<u-popup v-model="yhshow" mode="center" @close="popclose(1)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						修改用户名
					</text>
					<view class="pinput">
						<u-input v-model="pop.nickname" type="text" :border="false" placeholder="请输入"/>
					</view>
					<view class="quxiaoview">
						<view class="popquview" @click="popclose(1)">取消</view>
						<view class="popquview quebtn" @click="popbtn(1)">确认修改</view>
					</view>
				</view>
			</u-popup>

			<!-- 支付宝 -->
			<u-popup v-model="zfbshow" mode="center" @close="popclose(4)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						设置支付宝
					</text>
					<view class="pinput">
						<u-input v-model="pop.zfb_name" type="text" :border="false" placeholder="请输入支付宝姓名"/>
					</view>
					<view class="pinput">
						<u-input v-model="pop.zfb_code" type="text" :border="false" placeholder="请输入支付宝账号"/>
					</view>
					<view class="quxiaoview">
						<view class="popquview" @click="popclose(4)">取消</view>
						<view class="popquview quebtn" @click="popbtn(4)">确认修改</view>
					</view>
				</view>
			</u-popup>
			<!-- 银行卡 -->
			<u-popup v-model="yhkshow" mode="center" @close="popclose(5)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						设置银行卡
					</text>
					<view class="pinput">
						<u-input v-model="pop.bank_name" type="text" :border="false" placeholder="请输入银行卡"/>
					</view>
					<view class="pinput">
						<u-input v-model="pop.bank_code" type="text" :border="false" placeholder="请输入银行卡号"/>
					</view>
					<view class="quxiaoview">
						<view class="popquview" @click="popclose(5)">取消</view>
						<view class="popquview quebtn" @click="popbtn(5)">确认修改</view>
					</view>
				</view>
			</u-popup>
			<!-- 微信 -->
			<u-popup v-model="wxshow" mode="center" @close="popclose(6)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						设置微信
					</text>
					<view class="pinput">
						<u-input v-model="pop.wechat" type="text" :border="false" placeholder="请输入微信"/>
					</view>
					<view class="quxiaoview">
						<view class="popquview" @click="popclose(6)">取消</view>
						<view class="popquview quebtn" @click="popbtn(6)">确认修改</view>
					</view>
				</view>
			</u-popup>

			<!-- 实名认证 -->
			<u-popup v-model="smshow" mode="center" @close="popclose(7)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						实名认证
					</text>
					<view class="pinput">
						<u-input v-model="pop.sf_name" :disabled="shiming" type="text" :border="false" placeholder="请输入身份证姓名"/>
					</view>
					<view class="pinput">
						<u-input v-model="pop.sf_code" :disabled="shiming" type="text" :border="false" placeholder="请输入身份证号"/>
					</view>
					<view class="quxiaoview" v-if="shiming">
						<view class="popquview" @click="popclose(7)">取消</view>
						<view class="popquview quebtn" @click="popclose(7)">确认</view>
					</view>
					<view class="quxiaoview" v-if="!shiming">
						<view class="popquview" @click="popclose(7)">取消</view>
						<view class="popquview quebtn" @click="popbtn(7)">确认修改</view>
					</view>
				</view>
			</u-popup>
		</view>
		<!-- 修改手机号 -->
		<view class="yhupopview">
			<u-popup v-model="sjshow" mode="center" @close="popclose(2)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						修改手机号
					</text>
					<view class="pinput">
						<u-input v-model="pop.phone" type="text" :border="false" placeholder="请输入"/>
					</view>
					<view class="pinput">
						<u-input v-model="pop.code" type="text" :border="false" placeholder="请输入"/>
						<!-- <text class="huoqu">获取验证码</text> -->
						<view class="huoqu"  v-if="isTimer">{{time}}s</view>
						<view class="huoqu" v-else @click="lockSheet">获取验证码</view>
					</view>
					<view class="quxiaoview">
						<view class="popquview" @click="popclose(2)">取消</view>
						<view class="popquview quebtn" @click="popbtn(2)">确认修改</view>
					</view>
				</view>
			</u-popup>
		</view>
		<!-- 修改密码 -->
		<view class="yhupopview">
			<u-popup v-model="psdshow" mode="center" @close="popclose(3)" width="82%" :closeable="true" z-index="1000">
				<view class="yhpop">

					<text class="yhtit">
						设置登录密码
					</text>
					<text class="sjhao">手机号+86 {{user.mobile}}</text>
					<view class="pinput">
						<u-input v-model="pop.micode" type="text" :border="false" placeholder="请输入验证码"/>
						<view class="huoqu"  v-if="isTimer">{{time}}s</view>
						<view class="huoqu" v-else @click="lockSheet">获取验证码</view>
					</view>
					<view class="pinput">
						<u-input v-model="pop.password" type="password" :border="false" placeholder="请输入密码"/>
					</view>
					<view class="pinput">
						<u-input v-model="pop.confirm_password" type="password" :border="false" placeholder="请确认密码"/>
						
					</view>
					<view class="quxiaoview">
						<view class="popquview" @click="popclose(3)">取消</view>
						<view class="popquview quebtn" @click="popbtn(3)">确认修改</view>
					</view>
				</view>
			</u-popup>
		</view>

		<!-- 地址 -->
		<!-- <Adresspop :dishow="dishow" @adressclose="dishow=false" @adressbtn="adressbtn"></Adresspop> -->
	</view>
</template>

<script>
// import Adresspop from "@/components/Adresspop/Adresspop";
import {
		baseUrl
	} from '@/utils/config.js';
import { h } from "vue";
	export default {
		components:{
			// Adresspop
		},
		data() {
			return {
				value:'',
				wang:'',
				bshow:false,
				blist:[
					{
						value: '1',
						label: '江'
					},
					{
						value: '2',
						label: '湖'
					}
				],
				mineinfo:{
					profile:{
						avatar:'',
						email:''
					}
				},
				passwd:'',
				passwd_confirmation:'',
				code:'',

				timer: null,
				time: 60,
				isTimer: false,
				headimg:'',
				head_portrait:'',//传给接口

				yhshow:false,
				sjshow:false,
				psdshow:false,
				info:{},
				user:{
					phone:''
				},
				dishow:false,
				diinfo:"",
				newdiinfo:{},
				pop:{
					micode:'',
					phone:'',
					code:'',
					nickname:'',
					password:'',
					confirm_password:'',
					zfb_name:'',
					zfb_code:'',
					bank_name:'',
					bank_code:'',
					wechat:'',
					sf_code:'',//身份证号
					sf_name:'',//身份证姓名
				},
				nickname:'',
				zfbshow:false,
				yhkshow:false,
				wxshow:false,
				smshow:false,
				shiming:false,//true 就是不可修改
				banben: '',
			}
		},
		onLoad() {
			this.getuserinfo()
			
		},
		created() {
			let that = this
			// #ifdef APP-PLUS
			plus.runtime.getProperty(plus.runtime.appid, function (widgetInfo) {
				that.banben = widgetInfo.version
			})
			// #endif

			// 
		},
		onShow() {
		},
		methods: {
			async getuserinfo(){
				let res = await this.$u.api.usergetData({
				});
				this.user = res
				// this.user = res.user
				// console.log(this.user)
				// if(this.info.province_full){
				// 	this.diinfo = this.user.province_full
				// }
				
				// this.getadress()
				// if(this.user.sf_name!=''&&this.user.sf_code!=''){
				// 	this.shiming = true
				// }else{
				// 	this.shiming = false
				// }
				if(this.user.is_shiming == 1){
					//已经实名
					this.shiming = true
				}
			},
			async getadress(){
				let res = await this.$u.api.regionall({
				});
				let data = res
				let sheng = {}
				let shi = {}
				let qu = {}
				for(let i in data){
					if(data[i].id == this.user.province_id){
						sheng = data[i]
						for(let j in data[i].children){
							if(data[i].children[j].id == this.user.city_id){
								shi = data[i].children[j]
								for(let k in data[i].children[j].children){
									if(data[i].children[j].children[k].id == this.user.city_id){
										qu = data[i].children[j].children[k]
									}
								}
							}
						}
					}
				}
				// console.log(res)
				// this.adress = res
				// this.province = res
				// this.city = res[0].children
				// this.area = res[0].children[0].children
			},
			upload(e) {
				// this.updatetype = e
				uni.chooseImage({
					count: 1,
					success: (chooseImageRes) => {
						const tempFilePaths = chooseImageRes.tempFilePaths;
						this.headimg = tempFilePaths[0];
						// this.isClick = true;
						this.unloadtou()
						// this.getavatar();//修改信息
					}
				});
			},
			unloadtou(){
				// console.log(this.head_portrait)
				let that = this
				uni.uploadFile({
					// url: baseUrl + '/api/uploadImage', //仅为示例，非真实的接口地址
					url: baseUrl + '/common/upload', //仅为示例，非真实的接口地址
					filePath: this.headimg,
					name: 'file',
					header: {
						// 'content-type': 'application/json;charset=UTF-8',
						'token':uni.getStorageSync('token'),
					},
					formData: {
						'token':uni.getStorageSync('token'),
					},
					success: (uploadFileRes) => {
						console.log( JSON.parse(uploadFileRes.data).data);
						that.head_portrait = JSON.parse(uploadFileRes.data).data.fullurl
						that.getavatar();//修改信息
						// that.getinfo()
					}
				});
			},
			async getavatar(){
				let res = await this.$u.api.profile({
					avatar:this.head_portrait
				});
				this.$u.toast("上传成功");
				this.getshuxin()
			},
			async getpsdedit(){
				if(!this.diinfo){
					this.$u.toast("请选择地址");
					return false;
				}
				// if(!this.passwd_confirmation){
				// 	this.$u.toast("请输入确认密码");
				// 	return false;
				// }
				// if(!this.code){
				// 	this.$u.toast("请输入邮箱验证码");
				// 	return false;
				// }
				// if(this.passwd.length<8){
				// 	this.$u.toast('密码最小长度为8位');
				// 	return false
				// }
				// if(this.passwd != this.passwd_confirmation){
				// 	this.$u.toast('确认两次密码是否一致');
				// 	return false
				// }
				// if(!this.passwd_confirmation){

				// }
				let res = await this.$u.api.useredit({
					passwd:this.passwd,
					passwd_confirmation:this.passwd_confirmation,
					code:this.code,
					// type:'RESET_PASS'
				});
				this.$u.toast("操作成功");
				// console.log(res)
			},
			xuanwang(){
				this.bshow = true
			},
			bconfirm(e){
				console.log(e)
				this.wang = e[0].value
			},
			getrightClick(){
				this.navrouter("/pages/TPage/BiRecord?type=2");
			},
			async getcode(){
				if(!this.mineinfo.profile.email){
					this.$u.toast("请输入邮箱");
					return false;
				}
				this.isTimer = true;
				this.timer = setInterval(() => {
					this.time--
					if (this.time < 0) {
						this.isTimer = false;
						this.time = 60;
						clearInterval(this.timer);
					};
				}, 1000);
				let res = await this.$u.api.sendEmail({
					email: this.mineinfo.profile.email,
					type:'RESET_PASS'
				});
				// console.log(res)
				this.$u.toast("发送成功");
			},
			popclose(e){
				if(e == 1){
					this.yhshow = false
				}else if(e == 2){
					this.sjshow = false
				}else if(e == 3){
					this.psdshow = false
				}else if(e == 4){
					this.zfbshow = false
				}else if(e == 5){
					this.yhkshow = false
				}else if(e == 6){
					this.wxshow = false
				}else if(e == 7){
					this.smshow = false
				}
			},
			ptwoClick(e){
				if(e == 1){
					//支付宝
					this.pop.zfb_name = this.user.alipay_name
					this.pop.zfb_code = this.user.alipay_code
					this.zfbshow = true
				}else if(e == 2){
					//银行卡
					this.pop.bank_name = this.user.bank_name
					this.pop.bank_code = this.user.bank_code
					this.yhkshow = true
				}else if(e == 3){
					//微信
					this.pop.wechat = this.user.wechat_code
					this.wxshow = true
				}else if(e == 4){
					//实名认证
					
					this.pop.sf_name = this.user.sf_name
					this.pop.sf_code = this.user.sf_code
					this.smshow = true
				}
			},
			ziliaoClick(e){
				if(e == 1){
					//发票管理
					this.navrouter("/pages/TPage/FaPiaoManage");
				}else if(e == 2){
					//联系我们
					this.navrouter("/pages/TPage/LianXi");
				}else if(e == 3){
					//用户协议
					this.navrouter("/pages/TPage/Xieyi?type=yonghuxieyi");
				}else if(e == 4){
					//隐私协议
					this.navrouter("/pages/TPage/Xieyi?type=yinsixieyi");
				}
			},
			async adressbtn(e){
				console.log(e)
				this.newdiinfo = e
				this.diinfo = this.newdiinfo.province+'-'+this.newdiinfo.city+'-'+this.newdiinfo.area
				let res = await this.$u.api.useredit({
					province_id: this.newdiinfo.provinceid,
					city_id: this.newdiinfo.cityid,
					area_id: this.newdiinfo.areaid,
				});
				this.$u.toast("修改成功");
				this.getshuxin()
			},
			getdiqu(){
				this.dishow = true
			},
			getshouji(){
				this.sjshow = true
				this.pop.phone = this.user.phone
				this.pop.code = ''
			},
			getyhuming(){
				this.yhshow = true
				this.pop.nickname = this.user.nickname
			},
			getxiumi(){
				this.psdshow = true
				this.pop.password = ''
				this.pop.confirm_password = ''
			},
			async popbtn(e){
				if(e == 2){
					//修改手机号
					if(!this.pop.phone){
						this.$u.toast("请输入手机号");
						return false;
					}
					if(!this.pop.code){
						this.$u.toast("请输入验证码");
						return false;
					}
					let res = await this.$u.api.useredit({
						phone: this.pop.phone,
						code:this.pop.code
					});
					this.$u.toast("修改成功");
					this.sjshow = false
					this.pop.phone = ''
					this.pop.code = ''
					this.getshuxin();//刷新接口
				}else if( e == 1){
					//修改用户名
					
					if(!this.pop.nickname){
						this.$u.toast("请输入用户名");
						return false;
					}
					let res = await this.$u.api.editNickname({
						nickname: this.pop.nickname
					});
					this.$u.toast("修改成功");
					this.yhshow = false
					this.pop.nickname = ''
					this.getshuxin();//刷新接口
				}else if( e == 3){
					//修改密码
					
					if(!this.pop.password){
						this.$u.toast("请输入密码");
						return false;
					}
					if(!this.pop.confirm_password){
						this.$u.toast("请确认输入密码");
						return false;
					}
					if(!this.pop.micode){
						this.$u.toast("请确认验证码");
						return false;
					}
					let res = await this.$u.api.resetpwd({
						mobile: this.user.mobile,
						newpassword: this.pop.confirm_password,
						captcha:this.pop.micode
					});
					this.$u.toast("修改成功");
					this.psdshow = false
					this.pop.password = ''
					this.pop.confirm_password = ''
					this.pop.micode =''
					this.getshuxin();//刷新接口
				}else if(e == 4){
					//修改支付宝
					if(!this.pop.zfb_name){
						this.$u.toast("请输入姓名");
						return false;
					}
					if(!this.pop.zfb_code){
						this.$u.toast("请输入支付宝账号");
						return false;
					}
					let res = await this.$u.api.editZfb({
						zfb_name: this.pop.zfb_name,
						zfb_code:this.pop.zfb_code
					});
					this.$u.toast("修改成功");
					this.zfbshow = false
					this.pop.zfb_name = ''
					this.pop.zfb_code = ''
					this.getshuxin();//刷新接口
				}else if(e == 5){
					//修改银行卡
					if(!this.pop.bank_name){
						this.$u.toast("请输入银行卡");
						return false;
					}
					if(!this.pop.bank_code){
						this.$u.toast("请输入银行卡号");
						return false;
					}
					let res = await this.$u.api.editBank({
						bank_name: this.pop.bank_name,
						bank_code:this.pop.bank_code
					});
					this.$u.toast("修改成功");
					this.yhkshow = false
					this.pop.bank_name = ''
					this.pop.bank_code = ''
					this.getshuxin();//刷新接口
				}else if(e == 6){
					//修改微信
					if(!this.pop.wechat){
						this.$u.toast("请输入微信");
						return false;
					}
					let res = await this.$u.api.editWechat({
						wechat: this.pop.wechat
					});
					this.$u.toast("修改成功");
					this.wxshow = false
					this.pop.wechat = ''
					this.getshuxin();//刷新接口
				}else if(e == 7){
					//实名认证
					if(!this.pop.sf_name){
						this.$u.toast("请输入身份证姓名");
						return false;
					}
					if(!this.pop.sf_code){
						this.$u.toast("请输入身份证号");
						return false;
					}
					let res = await this.$u.api.editShiming({
						sf_code: this.pop.sf_code,
						sf_name: this.pop.sf_name,
					});
					this.$u.toast("修改成功");
					this.smshow = false
					this.pop.sf_code = ''
					this.pop.sf_name = ''
					this.getshuxin();//刷新接口
				}
			},
			getshuxin(){
				this.getuserinfo()
			},
			async lockSheet() {
				if(!this.user.mobile){
					this.$u.toast("请输入手机号");
					return false;
				}
				
				let res = await this.$u.api.smsSend({
					mobile: this.user.mobile,
					event:'changepwd'
				});
				this.isTimer = true;
				this.timer = setInterval(() => {
					this.time--
					if (this.time < 0) {
						this.isTimer = false;
						this.time = 60;
						clearInterval(this.timer);
					};
				}, 1000);
				this.$u.toast("发送成功");
				// this.yanshow = true
				// this.initYpRiddler()
				// this.$refs.captcha.initYpRiddler();
				// this.$refs.captcha.verify();
			},
			gettui(){
				//退出登陆
				let that = this
				uni.showModal({
					title: '提示',
					content: '确定退出登录？',
					cancelText: "取消", // 取消按钮的文字  
					confirmText: "确认", // 确认按钮的文字  
					// showCancel: false, // 是否显示取消按钮，默认为 true
					// confirmColor: '#f55850',
					// cancelColor: '#39B54A',
					success: (res) => {
					if(res.confirm) {  
						uni.clearStorageSync();
						that.$store.commit('outLogin');
						that.$u.toast('退出成功');
						setTimeout(() => {
							uni.redirectTo({
								url: '/pages/login/login'
							})
						}, 1000);
					} else {  
						console.log('cancel') //点击取消之后执行的代码
						}  
					} 
				})
			},
			getpugying(){
				let puurl = 'https://www.pgyer.com/1roGoEy0'
				// #ifdef APP-PLUS
				
				plus.runtime.openURL(puurl, function (res) {
				});
				// #endif
				// #ifdef H5
				location.href = puurl
				// #endif
			},
			async getweijie(){
				let res = await this.$u.api.delbind({
					});
				this.$u.toast('操作成功');
			}

		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #F5F5F5;
	}
	.chongji{
		width: 38rpx;
		height: 36rpx;
	}
	.content{
		background-color: #F5F5F5;
		padding: 30rpx 30rpx;
		min-height: 100vh;
		.xinxi{
			background: #FFFFFF;
			border-radius: 30rpx;
			padding: 0 30rpx;
			margin-bottom: 20rpx;
		}
		.mpone{
			display: flex;
			flex-direction: row;
			align-items: center;
			padding: 35rpx 0;
			border-bottom: 1rpx solid #EEEEEE;

			.touview{
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
				margin-right: 30rpx;
				position: relative;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			.tou2{
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
				position: absolute;
			}
			.xj{
				position: relative;
				z-index: 1;
				width: 42rpx;
				height: 38rpx;
			}
			.mpright{
				flex: 1;
				display: flex;
				flex-direction: column;
				padding-left: 50rpx;
				.xiugai{
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 30rpx;
					color: #c0c4cc;
					display: block;
					text-align: right;
				}
				.yxname{
					font-family: Source Han Sans CN;
					font-weight: bold;
					font-size: 24rpx;
					color: #000000;
				}
				.dengview{
					display: flex;
					flex-direction: row;
					align-items: center;
					margin-top: 10rpx;
					.idnum{
						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 24rpx;
						color: #000000;
						display: inline-block;
						margin-right: 13rpx;
					}
					.dengji{
						padding: 5rpx 30rpx;
						background: #FF8004;
						border-radius: 14rpx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 20rpx;
						color: #FFFFFF;
					}
				}
			}
		}
		.qian{
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-bottom: 45rpx;
			.qbiao{
				display: inline-block;
				width: 8rpx;
				height: 36rpx;
				background: #FF8004;
				margin-right: 8rpx;

			}
			.qname{
				font-family: Source Han Sans CN;
				font-weight: bold;
				font-size: 30rpx;
				color: #000000;
			}
		}
		.uone{
			display: flex;
			flex-direction: column;
			// margin-bottom: 40rpx;
			.uhead{
				display: flex;
				flex-direction: row;
				align-items: center;

			}
			.usdt{
				width: 46rpx;
				height: 46rpx;
				margin-right: 12rpx;
			}
			.uname{
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 24rpx;
				color: #000000;
			}
		}
		
		.ushuru{
			padding: 35rpx 0rpx;
			display: flex;
			align-items: center;
			flex-direction: row;
			border-bottom: 1rpx solid #eee;
			.lval{
				width: 150rpx;
				font-family: PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #333333;
				display: inline-block;
				margin-right: 20rpx;
			}
			
			.ml{
				margin-left: auto;
			}
			/deep/.u-input__input{
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
				min-height: 20px !important;
			}
			.xingview{
				margin-left: auto;
				display: flex;
				flex-direction: row;
				align-items: center;
				.xitem{
					display: flex;
					flex-direction: row;
					align-items: center;
					margin-left: 70rpx;
					.sexs{
						width: 30rpx;
						height: 30rpx;
						margin-right: 8rpx;
					}
					text{
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 30rpx;
						color: #111111;
					}
				}
			}
			.xuantit{
				color: #c0c4cc;
			}
			.xactive{
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
			}
			.xia{
				margin-left: auto;
				width: 16rpx;
				height: 10rpx;
			}
			.quanbu{
				margin-left: 10rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 28rpx;
				color: #010101;
			}
			.huoqu{
				padding: 8rpx 28rpx;
				margin-left: 30rpx;
				background: rgba(255, 128, 4, 1);
				border-radius: 50rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}
		.uone:last-child .ushuru{
			border-bottom: none;
		}
		.ricons{
			margin-left: 20rpx;
			width: 24rpx;
			height: 24rpx;
		}
		.keyong{
			display: block;
			text-align: right;
			font-family: Source Han Sans CN;
			font-weight: 400;
			font-size: 22rpx;
			color: #010101;
			margin-bottom: 75rpx;
		}
		
		.sbotview{
			margin: 100rpx 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.shoufei{
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 22rpx;
				color: #010101;
				display: block;
				margin-bottom: 15rpx;


			}
			.btn{
				width: 100%;
				height: 88rpx;
				background: #496EE7;
				color: #fff;
				border: 1rpx solid #496EE7;
				border-radius: 40rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 30rpx;
				color: #FFFFFF;
			}
		}
		// padding-bottom: 150rpx;
	}

	.yhupopview{
		/deep/.u-mode-center-box{
			background-color: transparent;
		}
		.yhpop{
			border-radius: 24rpx;
			padding: 40rpx;
			background-color: #fff;
			.yhtit{
				display: block;
				text-align: center;
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #333333;
				margin-bottom: 45rpx;
			}
			.pinput{
				background: #F5F5F5;
				border-radius: 10rpx;
				padding:10rpx 20rpx;
				margin-bottom: 20rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				
			}
			.sjhao{
				display: block;
				font-weight: bold;
				font-size: 28rpx;
				color: #333333;
				margin-bottom: 20rpx;
			}
			.huoqu{
				margin-left: 20rpx;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #496EE7;
			}
			.quxiaoview{
				display: flex;
				flex-direction: row;
				margin-top: 40rpx;
				justify-content: space-between;
				width: 100%;
				.popquview{
					height: 68rpx;
					border-radius: 35rpx;
					border: 1rpx solid #111111;
					display: flex;
					align-items: center;
					justify-content: center;
					width: 48%;
				}
				.quebtn{
					background: linear-gradient(-82deg, #4BB6F0, #1D8DFD);
					color: #fff;
					border: none;
				}
			}
		}
	}
	.xuantit{
		color: #c0c4cc;
		flex: 1;
		text-align: right;
	}
	
	.icon_fz{
		width: 28rpx;
		height: 28rpx;
		margin-left: 10rpx;
	}
	.xuanactive{
		color: #333 !important;
	}
	.tuichu{
		margin: 40rpx 30rpx;
		height: 88rpx;
		border-radius: 20rpx;
		border: 1px solid #999999;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #666666;
	}
</style>
